import { Column, Entity, Index } from "typeorm";
import { BaseEntity } from "../../base/entity/base";
import { CommonAuditStatus } from "../../../interface";

/**
 * 供应商主体
 */
@Entity('supplier_info', { comment: '供应商信息' })
export class SupplierInfoEntity extends BaseEntity {
    @Index()
    @Column({ comment: '供应商名称', length: 200 })
    name: string;

    @Column({ comment: '联系人姓名', length: 50, nullable: true })
    contactName: string;

    @Index()
    @Column({ comment: '联系人手机号', length: 20, nullable: true })
    contactPhone: string;

    @Column({ comment: '地址', length: 500, nullable: true })
    address: string;

    @Column({ comment: '状态', type: 'enum', enum: CommonAuditStatus, default: CommonAuditStatus.PENDING })
    status: CommonAuditStatus;

    @Column({ comment: '驳回原因', nullable: true })
    rejectReason?: string;

    @Column({ comment: '租户ID(店铺ID)', nullable: true })
    tenantId: number

    @Column({ comment: '备注', nullable: true })
    remark: string;
}


